// ObjectTypeBrowser.cpp : implementation file
//

#include "StdAfx.h"
#include "ObjectTypeBrowser.h"
#include "ObjectCreateTool.h"

/////////////////////////////////////////////////////////////////////////////
// ObjectTypeBrowser dialog

ObjectTypeBrowser::ObjectTypeBrowser()
{
	m_createTool = 0;
}

/////////////////////////////////////////////////////////////////////////////
// ObjectTypeBrowser message handlers

void ObjectTypeBrowser::SetCategory( CObjectCreateTool *createTool,const CString &category )
{
	assert( createTool != 0 );
	m_createTool = createTool;
	m_category = category;
	std::vector<CString> types;
	GetIEditor()->GetObjectManager()->GetClassTypes( category,types );

	for (int i = 0; i < types.size(); i++)
	{
		SButtonInfo bi;
		bi.toolClassName = "EditTool.ObjectCreate";
		bi.name = types[i];
		bi.toolUserDataKey = "type";
		bi.toolUserData = types[i];
		AddButton(bi);
	}
}
